package com.ksyzt.ksite2.client.service;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.ksyzt.ksite2.shared.PageLoggerData;
import com.ksyzt.ksite2.shared.PageNewsData;
import com.ksyzt.ksite2.shared.modle.ATTACHMENTObj;
import com.ksyzt.ksite2.shared.modle.ATTACHMENTObjs;
import com.ksyzt.ksite2.shared.modle.COLUMNObj;
import com.ksyzt.ksite2.shared.modle.COLUMNObjs;
import com.ksyzt.ksite2.shared.modle.NEWSObj;
import com.ksyzt.ksite2.shared.modle.ORGANIZATIONObj;
import com.ksyzt.ksite2.shared.modle.ORGANIZATIONObjs;
import com.ksyzt.ksite2.shared.modle.PUSERObj;
import com.ksyzt.ksite2.shared.modle.VW_NEWSObj;

@RemoteServiceRelativePath("../systemconsole")
public interface ISysManager extends RemoteService {

	/********************** user login ****************************/
	public PUSERObj login(String name, String pwd) throws Exception;

	public PUSERObj checkCurrentUser() throws Exception;

	public void quit_sys_console() throws Exception;

	/***************** orgnization ******************************/
	public ORGANIZATIONObjs getOrganizations(int userid, int orgtype)
			throws Exception;

	public ORGANIZATIONObjs getOrganizationChildren(int poid) throws Exception;

	public ORGANIZATIONObj modifyOrganization(ORGANIZATIONObj org)
			throws Exception;

	public Boolean deleteOrganization(int oid) throws Exception;

	public ORGANIZATIONObjs getAllChildrens(int rootoid) throws Exception;

	// 栏目管理
	public COLUMNObjs getColumns(int userid, int orgtype) throws Exception;

	public COLUMNObjs getColumnChildren(int pid) throws Exception;

	public COLUMNObj modifyColumn(COLUMNObj org) throws Exception;

	public Boolean deleteColumn(int id) throws Exception;

	public COLUMNObjs getAllColumnChildrens(int rootid) throws Exception;

	/************************* news manager ***********************************/

	// 新闻编辑
	public PageNewsData getNews(int oid, int start, int pagesize)
			throws Exception;

	public VW_NEWSObj submitNews(NEWSObj news) throws Exception;

	public void deleteNews(int nid) throws Exception;

	public PageNewsData searchNews(String tag, int start, int pagesize)
			throws Exception;

	void changeNewsOid(String sb, Integer oid) throws Exception;

	/***************************** Attatch manager ***************************/
	public ATTACHMENTObjs getAttatchments(String nid) throws Exception;

	public void deleteAttatchment(Integer aid) throws Exception;

	public void updateAttatchment(ATTACHMENTObj att) throws Exception;

	COLUMNObj getColumn(int columnid) throws Exception;

	/****************************** Logger *********************************/

	public PageLoggerData getLogger(int page, int pagesize) throws Exception;

}
